#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>
#include <limits.h>

unsigned int
fancy_shift(unsigned int u, int k)
{
	return (u >> k)|(u << ((CHAR_BIT * sizeof u) - k));
}

unsigned int
do_stuff(unsigned int n)
{
	unsigned int m = 0;

	//m |= (n & 0x000000FF << 24) | (n & 0x0000FF00 << 8) | (n & 0x00FF0000 >> 8)
	//	| (n & 0xFF000000 >> 24);

	m |= fancy_shift(n & 0xFF000000, 24);
	m |= fancy_shift(n & 0x00FF0000, 8);
	m |= fancy_shift(n & 0x0000FF00, 24);
	m |= fancy_shift(n & 0x000000FF, 8);

	return m;
}

int
main(int argc, char **argv)
{
	unsigned int in;

	while (scanf("%u", &in) == 1)
		printf("%u ", do_stuff(in));
	putchar('\n');

	return 0;
}
